#ifndef _DRV_TS_H_
#define _DRV_TS_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <linux/input.h>
#include "ak_drv_common.h"

#define TS_POINT_MAX_NUM	10
#define LEN_HINT         512
#define LEN_OPTION_SHORT 512

struct ak_timeval {
	unsigned long sec;     /* seconds */
	unsigned long usec;    /* microseconds */
};

struct ak_ts_info{
	int x;
	int y;
};

struct ak_ts_event{
	int map;
	struct ak_ts_info info[TS_POINT_MAX_NUM];
};

/**
 * @brief find the number for the touch screen
 * 
 * @return int -1: not find
 * @return int other: number
 */
int ak_find_ts_number(void);

/**
 * ak_drv_ts_open: open touch screen driver
 * return: 0 - success; otherwise error code;
 */
int ak_drv_ts_open(void);

/**
 * ak_drv_ts_get_event: get touch screen event .
 * @ts[OUT]:  ts event
 * @ms[IN]:  time out .
 * return: 0 - success; otherwise error code;
 */
int ak_drv_ts_get_event(struct ak_ts_event *ts, long ms);

/**
 * ak_drv_ts_close: close touch screen .
 * return: 0 - success; otherwise error code;
 */
int ak_drv_ts_close(void);

#endif